package com.nfha.algorithm.geo.crossline.main;


import java.util.*;

import com.nfha.algorithm.geo.crossline.*;
import com.nfha.algorithm.util.Logger;


public class CrosslineLocalMain {

	static Logger logger=Logger.getConsoleLogger();
	
	private static Date now() {
		return Calendar.getInstance().getTime();
	}
	
	private enum Bridge{
		
		
		人民桥(113.256656,23.112582,113.257393,23.110804)
		,解放桥(113.257393,23.110804,113.271029,23.116795)
		,海珠桥(113.273024,23.119786,113.273922,23.117925)
		,江湾桥(113.286148,23.121215,113.28524,23.117418)
		,海印桥(113.29417,23.117609,113.29302,23.113961)
		,广州大桥(113.321644,23.119898,113.322722,23.111223)
		,猎德大桥(113.340267,23.118691,113.340554,23.111745)
		,华南大桥(113.358269,23.116996,113.35791,23.110149)
		,琶洲大桥(113.380655,23.117761,113.380511,23.109385)
		;
		
		GeoLine line;
		
		
		Bridge(double start_lon, double start_lat, double end_lon, double end_lat ) {
			
			line=new GeoLine(start_lon, start_lat, end_lon, end_lat);
			
		}
		
		
	}
	
	private enum Location{
		海天大厦(113.253732,23.109669)
		,西提码头(113.258727,23.113159)
		,堑口码头(113.268977,23.116176)
		,天字码头(113.277591,23.120887)
		,大元帅府码头(113.285604,23.11768)
		,珠江泳场(113.301558,23.111124)
		,珠江夜游广州塔码头(113.306292,23.109919)
		,珠江广场(113.315927,23.110355)
		,广州国际媒体港(113.326616,23.113222)
		,
		;
		
		GeoShipPoint geoPoint;

		 Location(double lon,double lat) {
			this.geoPoint = new GeoShipPoint(name(), lon, lat,null, now().getTime());
		}
		
		
	}
	
	private enum RiverLine{
		
		珠江夜游(
				Location.海天大厦
				,Location.西提码头
				,Location.堑口码头
				,Location.天字码头
				,Location.大元帅府码头
				,Location.珠江泳场
				,Location.珠江夜游广州塔码头
				,Location.珠江广场
                ,Location.广州国际媒体港
				
				
				);
		
		List<GeoShipPoint> points=new ArrayList<>();
		
		
		
       RiverLine(Location ...loctations){
			
			for(Location location :loctations) {
				location.geoPoint.imo=name();
				points.add(location.geoPoint);
			}
			
		}
		
		
		RiverLine(GeoShipPoint ...geoShipPoints){
			
			for(GeoShipPoint geoShipPoint :geoShipPoints) {
				points.add(geoShipPoint);
			}
			
		}



		private RiverLine(List<GeoShipPoint> points) {
			this.points = points;
		}
		
		
		
		
	}
	
	
	
	
	
	 public static void main(String[] args) throws Exception {
		
    	try(CrosslineExerciser exerciser=new CrosslineExerciser(5);){
    		
    		
    		List<CrosslineResult> rets= exerciser.exec(Bridge.海印桥.line, RiverLine.珠江夜游.points);
    		
    		
    		rets.addAll(exerciser.exec(Bridge.江湾桥.line, RiverLine.珠江夜游.points));
    		
    		
    		rets.addAll(exerciser.exec(Bridge.琶洲大桥.line, RiverLine.珠江夜游.points));
    		
    		//珠江夜游不会经过琶洲大桥,所以只会得到两个结果
    		for(CrosslineResult ret : rets) {
    			logger.debug("穿过",ret);
    		}
    		
    	
    	}
    	
    	
    	
    	
    	
    	
    	
	}
	
	
	
	
	
}
